Technical Q&APLAT 27 - Missing Low Memory Globals (9-Jan-97)Q I am getting a link error on my PowerPC application when I use the following low memory globals: LMGetHighHeapMark LMGetROMMapHandle LMGetStackLowPoint LMGetUnitTableEntryCount LMSetHighHeapMark LMSetROMMapHandle LMSetStackLowPoint LMSetUnitTableEntryCountWhat is wrong? Is there a workaround? A Unfortunately, these globals didn't make it into the Interface library on PowerPC machines. This problem was discovered after InterfaceLib was frozen and in ROM. We are aware of the problem and it has been reported as a bug. The problem is that InterfaceLib is in ROM, so it's not as simple as shipping a new replacement library. There is no good solution, but there is a workaround: Create an external function in a file (say Extra.c) to access the low-mem yourself (from native code only), as shown below. When an updated library is released, you only have to remove the Extra.c.o file from your link command and relink your app, not recompile it. UsingLMGetUnitTableEntryCount as an example:
// File: Extra.c // Add Extra.c.o to your PPCLink command line // Later, when a .xcoff file is provided by Apple, replace it with that, // and delete your Extra.c.o. file. #if defined(powerc) || defined (__powerc) pascal short LMGetUnitTableEntryCount() { return *(short *)0x01D2; } #endif --Lenae Rowland & Jason Yeo Worldwide Developer Technical Support Technical Q&A Previous Question | Contents | Next Question To contact us, please use the Contact Us page. |